package com.lxq.test2009.Main01;

import java.util.Scanner;

class Array{
    public int key;
    public double value;

    public Array() {
        this.key = 0;
        this.value = Integer.MAX_VALUE;
    }

    public Array(int i, double dis) {
        this.key = i+1;
        this.value = dis;
    }

    public int getKey() {
        return key;
    }

    public void setKey(int key) {
        this.key = key;
    }

    public double getValue() {
        return value;
    }

    public void setValue(double value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return "Array{" +
                "key=" + key +
                ", value=" + value +
                '}';
    }
}

public class Main01 {
    static Array[] array = new Array[3];
    public static void compare(Array arr){
        System.out.println(array[0].toString()+array[1].toString()+array[2].toString());
        if (arr.value < array[2].value){
            if (arr.value < array[1].value){
                array[2] = array[1];
                if (arr.value < array[0].value){
                    array[1] = array[0];
                    array[0] = arr;
                }else if (arr.value > array[0].value){
                    array[1] = arr;
                }
            }else if (arr.value > array[1].value){
                array[2] = arr;
            }

        }



    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n,a,b;
        int[] key = new int[3];
        double[] value = new double[3];

        n=sc.nextInt();
        a=sc.nextInt();
        b=sc.nextInt();

        for (int i=0 ; i<n ; i++){
            int x,y;
            x=sc.nextInt();
            y=sc.nextInt();
            double dis = Math.sqrt(Math.pow(x-a,2)-Math.pow(y-b,2));
            Array arr = new Array(i,dis);

            compare(arr);

        }

        System.out.println(array[0].key);
        System.out.println(array[1].key);
        System.out.println(array[2].key);
    }
}
